class BD_PauseMenu extends GFxMoviePlayer;

var GFxObject RootMC;
var GFxClikWidget ResumeButton;
var GFxClikWidget ExitButton;

function bool Start(optional bool StartedPaused = false)
{
	super.Start();
	Advance(0);
	
	RootMC = GetVariableObject("_root");
        `log("RootMC = "$RootMC);
	
	AddCaptureKey('XboxTypeS_A');
	AddCaptureKey('XboxTypeS_Start');
	AddCaptureKey('Enter');


	return true;
}

event bool WidgetInitialized(name Widgetname, name WidgetPathh, GFxObject Widget)
{
	switch(WidgetName)
	{
	case('resumeBTN'):
		ResumeButton = GFxClikWidget(Widget);
		ResumeButton.AddEventListener('CLIK_press', OnResumeButtonPress);
		break;
	case('exitBTN'):
		ExitButton = GFxClikWidget(Widget);
		ExitButton.AddEventListener('CLIK_press', OnExitButtonPress);
		break;
	default:
		break;
	}
	return true;
}

function OnResumeButtonPress(GFxClikWidget.EventData ev)
{
	BD_HUD(GetPC().MyHUD).CompletePauseMenuClose();
	
}

function OnExitButtonPress(GfxClikWidget.EventData ev)
{

	ConsoleCommand("open Castle_Menu");
}

function CloseMovie()
{
        RootMC.GoToAndPlay("close");
}


defaultproperties
{
	WidgetBindings.Add((WidgetName="resumeBtn",WidgetClass=class'GFxClikWidget'))
	WidgetBindings.Add((WidgetName="ExitBtn",WidgetClass=class'GFxClikWidget'))
	
	bPauseGameWhileActive=TRUE
}

